@extends("d.layout.index")
@section("con")
<div class="mws-panel grid_8">
	<div class="mws-panel-header">
    	<span><i class="icon-table"></i>{{$tname}}商品浏览&nbsp;&nbsp;&nbsp;<a href="/admin/recommend/addgs/{{$id}}/{{$tname}}" class="icon-plus"></a></span>
    </div>
    <div class="mws-panel-body no-padding">
        <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">
        <form method="get" action="/admin/recommend/list/{{$id}}/{{$tname}}">
        <div id="DataTables_Table_1_length" class="dataTables_length">
        <label>显示 
	        <select size="1" name="num" aria-controls="DataTables_Table_1">
		        <option value="10" @if(!isset($request['num']) || $request['num'] == 10)selected @endif>10</option>
		        <option value="20" @if(isset($request['num']) && $request['num'] == 20)selected @endif>20</option>
		        <option value="30" @if(isset($request['num']) && $request['num'] == 30)selected @endif>30</option>
		        <option value="50" @if(isset($request['num']) && $request['num'] == 50)selected @endif>50</option>
	        </select> 条
        </label>
        </div>
        <div class="dataTables_filter" id="DataTables_Table_1_filter">
        	<label>搜索: <input aria-controls="DataTables_Table_1" @if(isset($request['keywords'])) value='{{$request["keywords"]}}' @endif name="keywords" type="text"></label>
        	<input type="submit" class="btn btn-paimary" value="提交">
        </div>
        </form>
        <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
            <thead>
                <tr role="row">
                	<th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 160px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">id</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 208px;" aria-label="Browser: activate to sort column ascending">商品名</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 135px;" aria-label="Engine version: activate to sort column ascending">图片</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 195px;" aria-label="Platform(s): activate to sort column ascending">销量</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 98px;" aria-label="CSS grade: activate to sort column ascending">浏览量</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 98px;" aria-label="CSS grade: activate to sort column ascending">收藏量</th>
                    <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 98px;" aria-label="CSS grade: activate to sort column ascending">上架时间</th>
                	<th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 98px;" aria-label="CSS grade: activate to sort column ascending">操作</th>
                </tr>
            </thead>
            
       		<tbody role="alert" aria-live="polite" aria-relevant="all">
			@foreach($list as $k=>$v)
        		@if($k % 2 == 0)
                    <tr class="even">
                @else
                    <tr class="odd">
                @endif  
                    <td class="  sorting_1">{{$v['id']}}</td>
                    <td class=" ">{{$v['name']}}</td>
                    <td class=" "><img src="{{$path.'s_'.$v['pic']}}" alt=""></td>
                    <td class=" ">{{$v['sell_count']}}</td>
                    <td class=" ">{{$v['scan_count']}}</td>
                    <td class=" ">{{$v['love_count']}}</td>
                    <td class=" ">{{date("Y-m-d H:i:s",$v['ctime'])}}</td>
                    <td class = " " align="center">
                        <a href="/admin/recommend/gsdelete/{{$v['id']}}/{{$id}}/{{$v['name']}}" class="icon-trash" style="color:black;font-size:17px"></a>
                    </td>
                </tr>
            @endforeach
        	</tbody>
    	</table>
		    <div class="dataTables_paginate paging_full_numbers" id="pages">
		    	{!!$list->appends($request)->render()!!}	
		    </div>
    	</div>
	</div>
</div>
@endsection